<% if !params[:ticket][:status].blank? %>
  jQuery('[data-dropdown="statuses-<%= @ticket.id %>"]')
      .empty()
      .append('<span class="<%= status_icon_class(@ticket.status) %>"></span> ' +
          '<%= j(t(@ticket.status, scope: 'activerecord.attributes.ticket.statuses')) %>');

<% elsif !params[:ticket][:priority].blank? %>
  jQuery('[data-dropdown="priorities-<%= @ticket.id %>"]')
      .empty()
      .append('<span class="cc-priority-<%= @ticket.priority %> fa fa-circle-o"></span> ' +
          '<%= j(t(@ticket.priority, scope: 'activerecord.attributes.ticket.priorities')) unless params[:short] == 'true' %>');

<% else %>
  window.location.reload();
<% end %>

<%# close all dropdowns %>
var dropdowns = jQuery('.f-dropdown');
dropdowns.foundation('dropdown', 'close', dropdowns);
